import 'package:flutter_homemonitor/generated/json/base/json_convert_content.dart';
import 'package:flutter_homemonitor/model/build_info_entity.dart';

BuildInfoEntity $BuildInfoEntityFromJson(Map<String, dynamic> json) {
  final BuildInfoEntity buildInfoEntity = BuildInfoEntity();
  final int? id = jsonConvert.convert<int>(json['Id']);
  if (id != null) {
    buildInfoEntity.id = id;
  }
  final String? rowID = jsonConvert.convert<String>(json['RowID']);
  if (rowID != null) {
    buildInfoEntity.rowID = rowID;
  }
  final int? detectItemID = jsonConvert.convert<int>(json['DetectItemID']);
  if (detectItemID != null) {
    buildInfoEntity.detectItemID = detectItemID;
  }
  final dynamic detectItemDto = json['DetectItemDto'];
  if (detectItemDto != null) {
    buildInfoEntity.detectItemDto = detectItemDto;
  }
  final String? buildingName =
      jsonConvert.convert<String>(json['BuildingName']);
  if (buildingName != null) {
    buildInfoEntity.buildingName = buildingName;
  }
  final dynamic projectManagerName = json['ProjectManagerName'];
  if (projectManagerName != null) {
    buildInfoEntity.projectManagerName = projectManagerName;
  }
  final String? buildingAddress =
      jsonConvert.convert<String>(json['BuildingAddress']);
  if (buildingAddress != null) {
    buildInfoEntity.buildingAddress = buildingAddress;
  }
  final int? floors = jsonConvert.convert<int>(json['Floors']);
  if (floors != null) {
    buildInfoEntity.floors = floors;
  }
  final int? undergroundFloors =
      jsonConvert.convert<int>(json['UndergroundFloors']);
  if (undergroundFloors != null) {
    buildInfoEntity.undergroundFloors = undergroundFloors;
  }
  final dynamic buildingTypeUses = json['BuildingTypeUses'];
  if (buildingTypeUses != null) {
    buildInfoEntity.buildingTypeUses = buildingTypeUses;
  }
  final dynamic buildingBuiltYears = json['BuildingBuiltYears'];
  if (buildingBuiltYears != null) {
    buildInfoEntity.buildingBuiltYears = buildingBuiltYears;
  }
  final dynamic buildingPlaneForm = json['BuildingPlaneForm'];
  if (buildingPlaneForm != null) {
    buildInfoEntity.buildingPlaneForm = buildingPlaneForm;
  }
  final dynamic cameraNumber = json['CameraNumber'];
  if (cameraNumber != null) {
    buildInfoEntity.cameraNumber = cameraNumber;
  }
  final dynamic exteriorWallFacing = json['ExteriorWallFacing'];
  if (exteriorWallFacing != null) {
    buildInfoEntity.exteriorWallFacing = exteriorWallFacing;
  }
  final dynamic structuralSystem = json['StructuralSystem'];
  if (structuralSystem != null) {
    buildInfoEntity.structuralSystem = structuralSystem;
  }
  final dynamic verticalLoadBearingMember = json['VerticalLoadBearingMember'];
  if (verticalLoadBearingMember != null) {
    buildInfoEntity.verticalLoadBearingMember = verticalLoadBearingMember;
  }
  final dynamic horizontalLoadBearingMember =
      json['HorizontalLoadBearingMember'];
  if (horizontalLoadBearingMember != null) {
    buildInfoEntity.horizontalLoadBearingMember = horizontalLoadBearingMember;
  }
  final dynamic roofForms = json['RoofForms'];
  if (roofForms != null) {
    buildInfoEntity.roofForms = roofForms;
  }
  final dynamic doorsAndWindows = json['DoorsAndWindows'];
  if (doorsAndWindows != null) {
    buildInfoEntity.doorsAndWindows = doorsAndWindows;
  }
  final dynamic stairs = json['Stairs'];
  if (stairs != null) {
    buildInfoEntity.stairs = stairs;
  }
  final dynamic whetherChanges = json['WhetherChanges'];
  if (whetherChanges != null) {
    buildInfoEntity.whetherChanges = whetherChanges;
  }
  final dynamic salientFeatures = json['SalientFeatures'];
  if (salientFeatures != null) {
    buildInfoEntity.salientFeatures = salientFeatures;
  }
  final String? detectMan = jsonConvert.convert<String>(json['DetectMan']);
  if (detectMan != null) {
    buildInfoEntity.detectMan = detectMan;
  }
  final dynamic recordMan = json['RecordMan'];
  if (recordMan != null) {
    buildInfoEntity.recordMan = recordMan;
  }
  final String? checkMan = jsonConvert.convert<String>(json['CheckMan']);
  if (checkMan != null) {
    buildInfoEntity.checkMan = checkMan;
  }
  final String? detectTime = jsonConvert.convert<String>(json['DetectTime']);
  if (detectTime != null) {
    buildInfoEntity.detectTime = detectTime;
  }
  final dynamic remark = json['Remark'];
  if (remark != null) {
    buildInfoEntity.remark = remark;
  }
  final bool? isDelete = jsonConvert.convert<bool>(json['IsDelete']);
  if (isDelete != null) {
    buildInfoEntity.isDelete = isDelete;
  }
  final dynamic detectPictureList = json['DetectPictureList'];
  if (detectPictureList != null) {
    buildInfoEntity.detectPictureList = detectPictureList;
  }
  return buildInfoEntity;
}

Map<String, dynamic> $BuildInfoEntityToJson(BuildInfoEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['Id'] = entity.id;
  data['RowID'] = entity.rowID;
  data['DetectItemID'] = entity.detectItemID;
  data['DetectItemDto'] = entity.detectItemDto;
  data['BuildingName'] = entity.buildingName;
  data['ProjectManagerName'] = entity.projectManagerName;
  data['BuildingAddress'] = entity.buildingAddress;
  data['Floors'] = entity.floors;
  data['UndergroundFloors'] = entity.undergroundFloors;
  data['BuildingTypeUses'] = entity.buildingTypeUses;
  data['BuildingBuiltYears'] = entity.buildingBuiltYears;
  data['BuildingPlaneForm'] = entity.buildingPlaneForm;
  data['CameraNumber'] = entity.cameraNumber;
  data['ExteriorWallFacing'] = entity.exteriorWallFacing;
  data['StructuralSystem'] = entity.structuralSystem;
  data['VerticalLoadBearingMember'] = entity.verticalLoadBearingMember;
  data['HorizontalLoadBearingMember'] = entity.horizontalLoadBearingMember;
  data['RoofForms'] = entity.roofForms;
  data['DoorsAndWindows'] = entity.doorsAndWindows;
  data['Stairs'] = entity.stairs;
  data['WhetherChanges'] = entity.whetherChanges;
  data['SalientFeatures'] = entity.salientFeatures;
  data['DetectMan'] = entity.detectMan;
  data['RecordMan'] = entity.recordMan;
  data['CheckMan'] = entity.checkMan;
  data['DetectTime'] = entity.detectTime;
  data['Remark'] = entity.remark;
  data['IsDelete'] = entity.isDelete;
  data['DetectPictureList'] = entity.detectPictureList;
  return data;
}

extension BuildInfoEntityExtension on BuildInfoEntity {
  BuildInfoEntity copyWith({
    int? id,
    String? rowID,
    int? detectItemID,
    dynamic detectItemDto,
    String? buildingName,
    dynamic projectManagerName,
    String? buildingAddress,
    int? floors,
    int? undergroundFloors,
    dynamic buildingTypeUses,
    dynamic buildingBuiltYears,
    dynamic buildingPlaneForm,
    dynamic cameraNumber,
    dynamic exteriorWallFacing,
    dynamic structuralSystem,
    dynamic verticalLoadBearingMember,
    dynamic horizontalLoadBearingMember,
    dynamic roofForms,
    dynamic doorsAndWindows,
    dynamic stairs,
    dynamic whetherChanges,
    dynamic salientFeatures,
    String? detectMan,
    dynamic recordMan,
    String? checkMan,
    String? detectTime,
    dynamic remark,
    bool? isDelete,
    dynamic detectPictureList,
  }) {
    return BuildInfoEntity()
      ..id = id ?? this.id
      ..rowID = rowID ?? this.rowID
      ..detectItemID = detectItemID ?? this.detectItemID
      ..detectItemDto = detectItemDto ?? this.detectItemDto
      ..buildingName = buildingName ?? this.buildingName
      ..projectManagerName = projectManagerName ?? this.projectManagerName
      ..buildingAddress = buildingAddress ?? this.buildingAddress
      ..floors = floors ?? this.floors
      ..undergroundFloors = undergroundFloors ?? this.undergroundFloors
      ..buildingTypeUses = buildingTypeUses ?? this.buildingTypeUses
      ..buildingBuiltYears = buildingBuiltYears ?? this.buildingBuiltYears
      ..buildingPlaneForm = buildingPlaneForm ?? this.buildingPlaneForm
      ..cameraNumber = cameraNumber ?? this.cameraNumber
      ..exteriorWallFacing = exteriorWallFacing ?? this.exteriorWallFacing
      ..structuralSystem = structuralSystem ?? this.structuralSystem
      ..verticalLoadBearingMember =
          verticalLoadBearingMember ?? this.verticalLoadBearingMember
      ..horizontalLoadBearingMember =
          horizontalLoadBearingMember ?? this.horizontalLoadBearingMember
      ..roofForms = roofForms ?? this.roofForms
      ..doorsAndWindows = doorsAndWindows ?? this.doorsAndWindows
      ..stairs = stairs ?? this.stairs
      ..whetherChanges = whetherChanges ?? this.whetherChanges
      ..salientFeatures = salientFeatures ?? this.salientFeatures
      ..detectMan = detectMan ?? this.detectMan
      ..recordMan = recordMan ?? this.recordMan
      ..checkMan = checkMan ?? this.checkMan
      ..detectTime = detectTime ?? this.detectTime
      ..remark = remark ?? this.remark
      ..isDelete = isDelete ?? this.isDelete
      ..detectPictureList = detectPictureList ?? this.detectPictureList;
  }
}
